<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/receivablefolder/Receivable.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/system/receivablefolder/Receivable.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'ReceivableId',
                footer: "Foots",
                cnName: '应收',
                name: 'receivablefolder/Receivable',
                url: "base-write/Receivable/",
                sortName: "ReceivableId"
            });
            const editFormFields = ref({"ReceivableId":"","ReceivableName":"","Ordertype":"","EndReceiptTime":"","Payer":"","Payee":"","ReceivablePrice":"","ActualpaymentPrice":"","Remark":""});
            const editFormOptions = ref([[{"title":"流水号","required":true,"field":"ReceivableId","disabled":true},
                               {"title":"名称","field":"ReceivableName"}],
                              [{"dataKey":"FinancialCategoryId ","data":[],"title":"财务类别编号","field":"Ordertype","type":"select"},
                               {"title":"最后收款日期","field":"EndReceiptTime","type":"datetime"}],
                              [{"title":"付款人","field":"Payer"},
                               {"title":"收款人","field":"Payee"}],
                              [{"title":"应收金额","field":"ReceivablePrice","type":"decimal"},
                               {"title":"实收金额","field":"ActualpaymentPrice","type":"decimal"}],
                              [{"title":"备注","field":"Remark"}]]);
            const searchFormFields = ref({"ReceivableId":"","ReceivableName":"","Ordertype":"","Payer":"","EndReceiptTime":"","PayReceState":""});
            const searchFormOptions = ref([[{"title":"流水号","field":"ReceivableId","type":"text"},{"title":"名称","field":"ReceivableName","type":"text"},{"dataKey":"FinancialCategoryId ","data":[],"title":"财务类别编号","field":"Ordertype","type":"select"},{"title":"付款人","field":"Payer","type":"like"}],[{"title":"最后收款日期","field":"EndReceiptTime","type":"datetime"},{"dataKey":"应收状态","data":[],"title":"状态","field":"PayReceState","type":"select"}]]);
            const columns = ref([{field:'ReceivableId',title:'流水号',type:'string',width:220,readonly:true,require:true,align:'left',sort:true},
                       {field:'ReceivableName',title:'名称',type:'string',width:110,align:'left'},
                       {field:'Ordertype',title:'财务类别编号',type:'string',bind:{ key:'FinancialCategoryId ',data:[]},width:220,align:'left'},
                       {field:'Payer',title:'付款人',type:'string',width:110,align:'left'},
                       {field:'Payee',title:'收款人',type:'string',width:110,align:'left'},
                       {field:'ReceivablePrice',title:'应收金额',type:'decimal',width:110,align:'left'},
                       {field:'ActualpaymentPrice',title:'实收金额',type:'decimal',width:110,align:'left'},
                       {field:'ResiduePrice',title:'剩余金额',type:'decimal',width:110,align:'left'},
                       {field:'EndReceiptTime',title:'最后收款日期',type:'datetime',width:150,align:'left',sort:true},
                       {field:'Remark',title:'备注',type:'string',width:180,align:'left'},
                       {field:'PayReceState',title:'状态',type:'int',bind:{ key:'应收状态',data:[]},width:110,align:'left'},
                       {field:'CreateTime',title:'创建时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'IsDeleted',title:'是否删除',type:'sbyte',width:110,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
